package com.bagu.bean2;

import org.springframework.context.support.ClassPathXmlApplicationContext;
/*
* 静态工厂实例化bean，定义一个工厂类，提供一个静态方法用于生产bean实例，在将该工厂类及其静态方法配置给Spring即可
* */
public class Client {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
        TestService testService = (TestService) context.getBean("testService");
        testService.testservice1();
    }

}